/* 

==========================================================

DX490a - Summer 2010

Instructor: Stelios Manousakis

==========================================================

Class 1.3

The Startup file

Contents:

• Using the startup file

==========================================================

*/



//================= USING THE STARTUP FILE =================


// When SuperCollider boots, it first compiles the class library and then looks for a specific file to change default options if necessary. If this file exists, any code in it will be executed every time the library is recomplied. The path is:


// Mac OSX:

"/Library/Application Support/SuperCollider/startup.rtf"; // for all users

"~/Library/Application Support/SuperCollider/startup.rtf"; // for the current user only


// Linux:

"~/.sclang.sc"


// Windows:

// The file's name is "startup.sc" and must be in the same directory as PsyCollider




// Here is some of my startup file's content:

// change the appearance of the post window

Document.listener.background = Color(0, 0, 0, 0.95);

Document.listener.stringColor = Color(1, 1, 1, 1);

Document.postColor_(Color(0.2, 0.7, 0.3));

Document.listener.bounds = Rect(0, 245, 290, 635); // left-hand side of the screen


// position and color the servers

Server.local.window.bounds = Rect(0, 120, 290, 100);

Server.internal.window.bounds = Rect(0, 0, 290, 100);

Server.local.window.background = Color(0.4, 0.3, 0.3, 0.9);

Server.internal.window.background = Color(0.4, 0.4, 0.5, 0.9);


// give SC 32x the default memory

Server.internal.options.memSize = 8192 * 32;



// Now this is cool: auto-colorize syntax while you type! (a trick found in the sc-users list, I think it's Josh's):

Document.globalKeyDownAction_({arg doc, char, mod, unicode, keycode;

var cursor, open, closed;

var sstart=doc.selectionStart, ssize=doc.selectionSize;

(doc.name.find("htm").isNil 

and: {doc.name.find("rtf").isNil}

and: {doc.name.find("rtfd").isNil} 

and: {doc.isListener == false})

.if({

(unicode==13 or: {unicode==32 or: {unicode==3 or: {unicode==46}}}).if({

doc.syntaxColorize;

});

});

});



// For more, look here:

Using-the-Startup-File